<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //通过for 循环，求0-100的和
        //1+2+3+4+5+6+7+。。。。+100 = sum
        //1+2 = sum
        //sum +3 = sum
        // sum +4 = sum
        // sum +5 = sum
        //...
        sum = 0;
        for (var i = 1; i <=100 ;i++){
            // console.log(i);
            sum = sum +i;
            sum +=i;
        }
        console.log(sum);
        // 总结：1. 遍历 1-100
        // 2. 引入变量保存值去的和
    </script>
</head>
<body>
    
</body>
</html>